quartz: add virtual modifiers already in GDK, just as X11 does it
authorMichael Natterer <mitch@lanedo.com>
Thu, 19 Jan 2012 15:12:11 +0000 (16:12 +0100)
committerMichael Natterer <mitch@gimp.org>
Thu, 19 Jan 2012 15:29:41 +0000 (16:29 +0100)
Key event states  will now always contain GDK_META_MASK in addition
to GDK_MOD2_MASK.
(cherry picked from commit d915d17ff66be926616565865f941289d8a1024b)

gdk/quartz/gdkevents-quartz.c

index 3528f3582a84f805a2171bdce912cc7ebe65e772..67934c50c9c2e8f6d64155e3e2343fc7ca3ba7a2 100644 (file)
@@ -963,6 +963,13 @@ fill_key_event (GdkWindow    *window,
 
   event->key.state |= _gdk_quartz_events_get_current_mouse_modifiers ();
 
+  /* The X11 backend adds the first virtual modifier MOD2..MOD5 are
+   * mapped to. Since we only have one virtual modifier in the quartz
+   * backend, calling the standard function will do.
+   */
+  gdk_keymap_add_virtual_modifiers (gdk_keymap_get_for_display (_gdk_display),
+                                    &event->key.state);
+
   event->key.string = NULL;
 
   /* Fill in ->string since apps depend on it, taken from the x11 backend. */